package thread.ch05;

import java.util.concurrent.BlockingQueue;

/**
 * TaskRunnable
 * <p/>
 * Restoring the interrupted status so as not to swallow the interrupt
 * 
 * @author Edgar Zhang
 * 
 */
public class TaskRunnable implements Runnable {

	BlockingQueue<Task> queue;
	
	@Override
	public void run() {
		try {
			processTask(queue.take());
		} catch (InterruptedException e) {
			Thread.currentThread().interrupt();
		}
	}
	
	void processTask(Task task) {
		
	}
	
	interface Task {}

}
